//
//  LeftViewController.m
//  HospitalSystem
//
//  Created by jss on 16/5/4.
//
//

#import "LeftViewController.h"
#import "LoginViewController.h"
#import "RegisterController.h"
#import <UIViewController+JASidePanel.h>
#import <JASidePanelController.h>

@interface LeftViewController ()

//tableView
@property (weak, nonatomic) IBOutlet UITableView *tableView;

//没登录状态下的View
@property (weak, nonatomic) IBOutlet UIView *loginView;

//登陆成功下的view
@property (weak, nonatomic) IBOutlet UIView *loginSucView;


//登录成功View下的控件
@property (weak, nonatomic) IBOutlet UIImageView *headImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLable;
@property (weak, nonatomic) IBOutlet UILabel *desLable;

@property(nonatomic,assign)BOOL isLogin;

@end

@implementation LeftViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  
    //self.view.backgroundColor = [UIColor redColor];
    
    [self setupUI];
}

//设置界面
-(void)setupUI{

    self.loginSucView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"nav"]];
    
    self.headImageView.layer.cornerRadius = 30;
    
    self.headImageView.layer.masksToBounds = YES;

}


//设置登录界面隐藏问题
-(void)setupHide {
    
    
}
//点击短信注册登录按钮
- (IBAction)didClickMessageLoginBtn:(id)sender {
    
    NSLog(@"%s","111");
    
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Register" bundle:nil];
    
    UIViewController *registerVc = [sb instantiateViewControllerWithIdentifier:@"Register"];
    
     RegisterController *registerCtr = registerVc;
    
    registerCtr.loginBlock = ^{
        
        //跳转控制器
        
        NSLog(@"登录成功");
        
        
        
    };
    
    
    //跳转控制器
    [self.sidePanelController showCenterPanelAnimated:YES];
    
    //push到下一个Controller
    [(UINavigationController *)self.sidePanelController.centerPanel pushViewController:registerVc animated:YES];

    
    
}

//点击登录按钮
- (IBAction)didClickLoginBtn:(id)sender {
    
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"LoginStoryboard" bundle:nil];
    
    UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"LoginStoryboard"];
    
    LoginViewController *loginCtr = vc;
    
    loginCtr.loginBlock = ^{
      
         //跳转控制器
        
        NSLog(@"登录成功");
       
        
        
    };

    
     //跳转控制器
    [self.sidePanelController showCenterPanelAnimated:YES];
    
    //push到下一个Controller
    [(UINavigationController *)self.sidePanelController.centerPanel pushViewController:vc animated:YES];
    
}


@end
